package com.groupbuying.cheetah.service.impl;

import com.groupbuying.cheetah.dao.CheetahNewTmpOrderPayDao;
import com.groupbuying.cheetah.service.CheetahNewTmpOrderPayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @ClassName CheetahNewTmpOrderPayServiceImpl
 * @Description: TODO
 * @Author srlg
 * @Date 2019/10/31
 * @Version V1.0
 **/
@Service
public class CheetahNewTmpOrderPayServiceImpl implements CheetahNewTmpOrderPayService {

    @Autowired
    private CheetahNewTmpOrderPayDao cheetahNewTmpOrderPayDao;


    @Override
    public Map<String, Map> getStoreCheckoutCounter(String[] ids) {
        List<Map> lists = cheetahNewTmpOrderPayDao.getStoreCheckoutCounter(ids);

        Map<String,Map> retMap = new HashMap<>();
        for (Map list:lists) {
            //获取key
            String id = (String) list.get("uuid");
            retMap.put(id,list);
        }

        return retMap;
    }

    @Override
    public Map<String, Map> getStoreMainInfo(String[] ids) {
        List<Map> lists = cheetahNewTmpOrderPayDao.getStoreMainInfo(ids);

        Map<String,Map> retMap = new HashMap<>();
        for (Map list:lists) {
            //获取key
            String id = (String) list.get("uuid");
            retMap.put(id,list);
        }

        return retMap;
    }

    @Override
    public Map<String, Map> getPayOrderRel(String[] ids) {
        List<Map> lists = cheetahNewTmpOrderPayDao.getPayOrderRel(ids);

        Map<String,Map> retMap = new HashMap<>();
        for (Map list:lists) {
            //获取key
            String id = (String) list.get("order_id");
            retMap.put(id,list);
        }

        return retMap;
    }

    @Override
    public Map<String, Map> getPayInfo(String[] ids) {
        List<Map> lists = cheetahNewTmpOrderPayDao.getPayInfo(ids);

        Map<String,Map> retMap = new HashMap<>();
        for (Map list:lists) {
            //获取key
            String id = (String) list.get("id");
            retMap.put(id,list);
        }

        return retMap;
    }

    @Override
    public Map<String, Map> getSettleUshopSplitMaininfo(String[] ids) {
        List<Map> lists = cheetahNewTmpOrderPayDao.getSettleUshopSplitMaininfo(ids);

        Map<String,Map> retMap = new HashMap<>();
        for (Map list:lists) {
            //获取key
            String id = (String) list.get("order_id");
            retMap.put(id,list);
        }

        return retMap;
    }

    @Override
    public Map<String, Map> getSettleUshopFlowStore(String[] ids) {
        List<Map> lists = cheetahNewTmpOrderPayDao.getSettleUshopFlowStore(ids);

        Map<String,Map> retMap = new HashMap<>();
        for (Map list:lists) {
            //获取key
            String id = (String) list.get("external_id");
            retMap.put(id,list);
        }

        return retMap;
    }

    @Override
    public Map<String, Map> getStoreAccount(String[] ids) {
        List<Map> lists = cheetahNewTmpOrderPayDao.getStoreAccount(ids);

        Map<String,Map> retMap = new HashMap<>();
        for (Map list:lists) {
            //获取key
            String id = (String) list.get("provider_id");
            retMap.put(id,list);
        }

        return retMap;
    }

    @Override
    public Map<String, Map> getSysAgentInfo(String[] ids) {
        List<Map> lists = cheetahNewTmpOrderPayDao.getSysAgentInfo(ids);

        Map<String,Map> retMap = new HashMap<>();
        for (Map list:lists) {
            //获取key
            String id = (String) list.get("id");
            retMap.put(id,list);
        }

        return retMap;
    }

    @Override
    public Map<String, Map> getCustomerWxinfoRel(String[] ids) {
        List<Map> lists = cheetahNewTmpOrderPayDao.getCustomerWxinfoRel(ids);

        Map<String,Map> retMap = new HashMap<>();
        for (Map list:lists) {
            //获取key
            String id = (String) list.get("customer_id");
            retMap.put(id,list);
        }

        return retMap;
    }

    @Override
    public Map<String, Map> getCustomerUshop(String[] ids) {
        List<Map> lists = cheetahNewTmpOrderPayDao.getCustomerUshop(ids);

        Map<String,Map> retMap = new HashMap<>();
        for (Map list:lists) {
            //获取key
            String id = (String) list.get("customer_id");
            retMap.put(id,list);
        }

        return retMap;
    }

    @Override
    public Map<String, Map> getCustomerAliinfoRel(String[] ids) {
        List<Map> lists = cheetahNewTmpOrderPayDao.getCustomerAliinfoRel(ids);

        Map<String,Map> retMap = new HashMap<>();
        for (Map list:lists) {
            //获取key
            String id = (String) list.get("customer_id");
            retMap.put(id,list);
        }

        return retMap;
    }

    @Override
    public Map<String, Map> getSettleUshopSplitPlantform(String[] ids) {
        List<Map> lists = cheetahNewTmpOrderPayDao.getSettleUshopSplitPlantform(ids);

        Map<String,Map> retMap = new HashMap<>();
        for (Map list:lists) {
            //获取key
            String id = (String) list.get("settle_id");
            retMap.put(id,list);
        }

        return retMap;
    }

    @Override
    public Map<String, Map> getSettleUshopSplitStore(String[] ids) {
        List<Map> lists = cheetahNewTmpOrderPayDao.getSettleUshopSplitStore(ids);

        Map<String,Map> retMap = new HashMap<>();
        for (Map list:lists) {
            //获取key
            String id = (String) list.get("settle_id");
            retMap.put(id,list);
        }

        return retMap;
    }

    @Override
    public Map<String, Map> getSettleUshopSplitChannle(String[] ids) {
        List<Map> lists = cheetahNewTmpOrderPayDao.getSettleUshopSplitChannle(ids);

        Map<String,Map> retMap = new HashMap<>();
        for (Map list:lists) {
            //获取key
            String id = (String) list.get("settle_id");
            retMap.put(id,list);
        }

        return retMap;
    }

    @Override
    public Map<String, Map> getCurrencyCustomerLog(String[] ids) {
        List<Map> lists = cheetahNewTmpOrderPayDao.getCurrencyCustomerLog(ids);

        Map<String,Map> retMap = new HashMap<>();
        for (Map list:lists) {
            //获取key
            String id = (String) list.get("pay_id");
            retMap.put(id,list);
        }

        return retMap;
    }

    @Override
    public Map<String, Map> getCommodityOrderItem(String[] ids) {
        List<Map> lists = cheetahNewTmpOrderPayDao.getCommodityOrderItem(ids);

        Map<String,Map> retMap = new HashMap<>();
        for (Map list:lists) {
            //获取key
            String id = (String) list.get("order_id");
            retMap.put(id,list);
        }

        return retMap;
    }
}
